<template>
  <div>
    <h2>我是首页</h2>
    <p>我是首页内容,哈哈哈</p>
    <router-link to="/home/news">新闻</router-link>
    <router-link to="/home/message">消息</router-link>
    <router-view/>
  </div>
</template>

<script>
  export default {
    name: "Home",
    // path: "/home/news",
    path: "/user",
    created() {
      console.log("home created");
      // document.title = "首页"
    },
    destroyed() {
      console.log("home destroyed");
    },
    // // 当前活跃的
    // activated() {
    //   console.log("home activated");
    //   // this.$router.push(this.path);
    //   this.$router.push("/about");
    // },
    // // 当前不活跃的
    // deactivated() {
    //   console.log("home deactivated");
    //   console.log(this.$route.path);
    //   this.path = this.$route.path
    // }
    // beforeRouteLeave() {
    //   console.log(this.$route.path);
    //   this.path = this.$route.path
    // }
  }
</script>

<style scoped>

</style>
